package com.ssh.dao.impl;

import com.ssh.dao.IStudentDao;
import com.ssh.domain.Student;
import org.hibernate.query.Query;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository("studentDao")
public class StudentDaoImpl extends BaseDaoImpl<Student> implements IStudentDao {
    @Override
    public List<Student> findByName(String name) {
        Query<Student> query = sessionFactory.getCurrentSession().createQuery("from Student where name = :name", Student.class);
        query.setParameter("name", name);
        return query.list();
    }
}
